/**
 * Created by aaa on 2017/8/3.
 */

//http://127.0.0.1:7001/search?name=abc
exports.queryParam=function* (ctx) {
    ctx.body=`user: ${ctx.query.name}`;
}

// http://127.0.0.1:7001/user/1/tom
exports.params=function* (ctx) {
    ctx.body=`user: ${ctx.params.id}, ${ctx.params.name}`;
}

//http://127.0.0.1:7001/form [post with form]
exports.getform=function* (ctx) {
    // ctx.request.body 获取表达内容
    ctx.body=`body: ${JSON.stringify(ctx.request.body)}`;
}